package com.rs.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.rs.dao.ZhPositionMapper;
import com.rs.model.ZhPosition;
import com.rs.model.ZhUser;


@Service
@Transactional
public class ZhPositionServiceImpl implements com.rs.service.ZhPositionService {

	@Autowired
	private ZhPositionMapper zH;
	
	@Override
	public ZhPosition selectByPrimaryKey(Integer poId) {
		return zH.selectByPrimaryKey(poId);
	}

	@Override
	public int insertSelective(ZhPosition record) {
		//判断是否已存在
		if(null == zH.selectByExampleOne(record)) {
			return zH.insertSelective(record);
		}
		return 0;
	}

	@Override
	public int updateByPrimaryKeySelective(ZhPosition record) {
		return zH.updateByPrimaryKeySelective(record);
	}

	@Override
	public int deleteByPrimaryKey(Integer poId) {
		return zH.deleteByPrimaryKey(poId);
	}

	@Override
	public List<ZhPosition> selectByExample() {
		return zH.selectByExample();
	}
	
	@Override
	public Page<ZhPosition> selectByExampleAll(Integer Pagenum , ZhPosition rePosition) {
		PageHelper.startPage(Pagenum,10);
		return zH.selectByExampleAll(rePosition);
	}

	@Override
	public ZhPosition selectByNameKey(ZhPosition record) {
		return zH.selectByExampleOne(record);
	}

}
